package com.netease.pris.activity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.netease.framework.ActivityEx;
import com.netease.image.c;
import com.netease.l.a.a;
import com.netease.pris.a.f;
import com.netease.pris.app.PrisApp;
import com.netease.pris.offline.ProcessResult;
import com.netease.pris.offline.e;

public class PRISActivityOffline extends ActivityEx
  implements e
{
  private static final String I = "<font color=\"#FFFFFF\">%d</font>/<font color=\"#999999\">%d</font> ";
  private static final String a = PRISActivityOffline.class.getSimpleName();
  private static final boolean b;
  private ViewGroup A;
  private ViewGroup B;
  private ImageView C;
  private TextView D;
  private TextView E;
  private Button F;
  private int G = 1;
  private TextView H;
  private Handler J = new bl(this);
  private TextView c;
  private TextView d;
  private TextView e;
  private TextView f;
  private TextView g;
  private TextView u;
  private TextView v;
  private TextView w;
  private TextView x;
  private ProgressBar y;
  private TextView z;

  private void a(int paramInt)
  {
    this.G = paramInt;
    switch (paramInt)
    {
    default:
    case 1:
    case 0:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    }
    while (true)
    {
      return;
      if (this.A != null)
        this.A.setVisibility(0);
      if (this.B == null)
        continue;
      this.B.setVisibility(8);
      continue;
      if (this.A != null)
        this.A.setVisibility(8);
      if (this.B == null)
        continue;
      this.B.setVisibility(0);
    }
  }

  private void b(int paramInt, Object paramObject)
  {
    if (paramObject == null);
    while (true)
    {
      return;
      Message localMessage = Message.obtain(this.J);
      localMessage.what = paramInt;
      localMessage.obj = paramObject;
      this.G = paramInt;
      this.J.sendMessage(localMessage);
    }
  }

  private void e()
  {
    this.J.removeMessages(2);
    this.J.removeMessages(5);
    this.J.removeMessages(3);
    this.J.removeMessages(4);
    this.J.removeMessages(1);
    this.J.removeMessages(7);
    this.J.removeMessages(0);
    this.J.removeMessages(6);
  }

  public int a(int paramInt, Object paramObject)
  {
    if (paramObject == null);
    while (true)
    {
      return 0;
      b(paramInt, paramObject);
    }
  }

  protected void a(int paramInt, Message paramMessage)
  {
    int i = 2131362125;
    com.netease.g.b.c("Prisactivityoffline", "status: " + paramMessage.what);
    a(paramMessage.what);
    if (paramMessage.obj == null)
      return;
    ProcessResult localProcessResult = (ProcessResult)paramMessage.obj;
    switch (paramInt)
    {
    case 4:
    default:
    case 5:
    case 3:
    case 6:
    }
    while (true)
    {
      this.C.setImageResource(2130837706);
      this.D.setText(2131362123);
      TextView localTextView = this.E;
      Object[] arrayOfObject = new Object[3];
      arrayOfObject[0] = getString(i);
      arrayOfObject[1] = Integer.valueOf(localProcessResult.d());
      arrayOfObject[2] = f.a(this, localProcessResult.g());
      localTextView.setText(getString(2131362124, arrayOfObject));
      this.F.setText(2131362128);
      break;
      i = 2131362127;
      continue;
      i = 2131362126;
      continue;
      i = 2131362319;
    }
  }

  protected void a(Message paramMessage)
  {
    ProcessResult localProcessResult = (ProcessResult)paramMessage.obj;
    if (localProcessResult == null);
    while (true)
    {
      return;
      if (!TextUtils.isEmpty(localProcessResult.i()))
        this.c.setText(localProcessResult.i());
      this.y.setMax(localProcessResult.b());
      this.y.setProgress(localProcessResult.a());
      this.g.setText(f.a(this, localProcessResult.g()));
      this.v.setText(a.a(localProcessResult.h()));
      this.x.setText(localProcessResult.c());
      TextView localTextView1 = this.e;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = Integer.valueOf(localProcessResult.j() / 1024);
      localTextView1.setText(getString(2131362129, arrayOfObject1));
      TextView localTextView2 = this.H;
      Object[] arrayOfObject2 = new Object[2];
      arrayOfObject2[0] = Integer.valueOf(localProcessResult.f());
      arrayOfObject2[1] = Integer.valueOf(localProcessResult.e());
      localTextView2.setText(Html.fromHtml(String.format("<font color=\"#FFFFFF\">%d</font>/<font color=\"#999999\">%d</font> ", arrayOfObject2)));
      this.F.setText(2131362130);
    }
  }

  void b()
  {
    setTitle(2131362116);
    g(8);
    this.H = ((TextView)findViewById(2131558409));
    this.H.setVisibility(0);
    this.H.setTextSize(c.a(this, 14.0F));
    this.H.setTextColor(Color.rgb(153, 153, 153));
    this.F = ((Button)findViewById(2131558570));
    if (PrisApp.a().y())
    {
      this.F.setText(2131362130);
      this.G = 1;
    }
    while (true)
    {
      this.F.setOnClickListener(new bj(this));
      this.A = ((ViewGroup)findViewById(2131558568));
      View localView1 = this.A.findViewById(2131558578);
      View localView2 = this.A.findViewById(2131558581);
      View localView3 = this.A.findViewById(2131558582);
      View localView4 = this.A.findViewById(2131558583);
      this.d = ((TextView)localView1.findViewById(2131558576));
      this.d.setText(2131362118);
      this.c = ((TextView)localView1.findViewById(2131558577));
      this.f = ((TextView)localView2.findViewById(2131558576));
      this.f.setText(2131362119);
      this.e = ((TextView)localView2.findViewById(2131558577));
      this.f.setVisibility(8);
      this.e.setVisibility(8);
      this.u = ((TextView)localView3.findViewById(2131558576));
      this.u.setText(2131362120);
      this.g = ((TextView)localView3.findViewById(2131558577));
      this.w = ((TextView)localView4.findViewById(2131558576));
      this.w.setText(2131362121);
      this.v = ((TextView)localView4.findViewById(2131558577));
      this.x = ((TextView)findViewById(2131558580));
      this.x.setTextColor(Color.rgb(255, 255, 255));
      this.y = ((ProgressBar)findViewById(2131558579));
      this.z = ((TextView)findViewById(2131558584));
      this.z.setText(2131362122);
      this.B = ((ViewGroup)findViewById(2131558569));
      this.C = ((ImageView)this.B.findViewById(2131558573));
      this.D = ((TextView)this.B.findViewById(2131558574));
      this.E = ((TextView)this.B.findViewById(2131558575));
      Intent localIntent = getIntent();
      ProcessResult localProcessResult = (ProcessResult)localIntent.getParcelableExtra("extra_result");
      this.G = localIntent.getIntExtra("extra_status", 7);
      b(this.G, localProcessResult);
      PrisApp.a().a(this);
      return;
      this.F.setText(2131362117);
    }
  }

  protected void b(Message paramMessage)
  {
    a(paramMessage.what);
    if (paramMessage.obj == null);
    while (true)
    {
      return;
      ProcessResult localProcessResult = (ProcessResult)paramMessage.obj;
      this.C.setImageResource(2130837707);
      this.D.setText(2131362131);
      TextView localTextView1 = this.E;
      Object[] arrayOfObject1 = new Object[2];
      arrayOfObject1[0] = Integer.valueOf(localProcessResult.d());
      arrayOfObject1[1] = f.a(this, localProcessResult.g());
      localTextView1.setText(getString(2131362132, arrayOfObject1));
      this.F.setText(2131362117);
      TextView localTextView2 = this.H;
      Object[] arrayOfObject2 = new Object[2];
      arrayOfObject2[0] = Integer.valueOf(localProcessResult.f());
      arrayOfObject2[1] = Integer.valueOf(localProcessResult.e());
      localTextView2.setText(Html.fromHtml(String.format("<font color=\"#FFFFFF\">%d</font>/<font color=\"#999999\">%d</font> ", arrayOfObject2)));
    }
  }

  protected void c()
  {
    PrisApp.a().u();
    com.netease.pris.offline.b.a().b();
    if (this.G == 7)
    {
      Intent localIntent = new Intent(this, PRISActivityFlasScreen.class);
      localIntent.setAction("android.intent.action.MAIN");
      localIntent.addCategory("android.intent.category.LAUNCHER");
      startActivity(localIntent);
    }
    finish();
  }

  protected void c(Message paramMessage)
  {
    a(paramMessage.what);
    if (paramMessage.obj == null);
    while (true)
    {
      return;
      ProcessResult localProcessResult = (ProcessResult)paramMessage.obj;
      this.C.setImageResource(2130837706);
      this.D.setText(2131362123);
      TextView localTextView = this.E;
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = Integer.valueOf(localProcessResult.d());
      arrayOfObject[1] = f.a(this, localProcessResult.g());
      localTextView.setText(getString(2131362124, arrayOfObject));
      this.F.setText(2131362128);
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903092);
    b();
    a(1);
  }

  protected void onDestroy()
  {
    PrisApp.a().b(this);
    e();
    super.onDestroy();
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.PRISActivityOffline
 * JD-Core Version:    0.6.0
 */